package com.taoz.mianshiwa.constant;

public interface RedisConstant {
    String USER_SIGNIN_KEY_PREFIX = "user:signin";
    String USER_ACCESS_KEY_PREFIX = "user:access";

    /**
     * 获取用户签到的key
     * @param year
     * @param userId
     * @return
     */
    static String getUserSignInKey(int year, long userId) {
        return String.format("%s:%s:%s", USER_SIGNIN_KEY_PREFIX, year, userId);
    }

    static String getUserAccessKey(long userId) {
        return String.format("%s:%s", USER_ACCESS_KEY_PREFIX, userId);
    }
}
